//
//  AboutViewController.m
//  Remind
//
//  Created by macZF on 2017/10/25.
//  Copyright © 2017年 2017.09.27. All rights reserved.
//

#import "AboutViewController.h"
#import "UIViewController+LGSideMenuController.h"
#import "LGSideMenuController.h"

@interface AboutViewController () <UITableViewDataSource,UITableViewDelegate>
{
    NSArray *data;
}
@end

@implementation AboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"菜单"] style:UIBarButtonItemStylePlain target:self action:@selector(showLeftMenu)];
    self.view.backgroundColor = [UIColor colorWithRed:229/255.0 green:229/255.0 blue:229/255.0 alpha:1.0];
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.view.frame) - 89)/2, 120, 89, 89)];
    imgView.layer.cornerRadius = 10.0;
    //imgView.layer.masksToBounds = YES;
    imgView.clipsToBounds = YES;
    imgView.image = [UIImage imageNamed:@"icon"];
    [self.view addSubview:imgView];
    data = @[@{
                 @"name":@"版本号",
                 @"value":@"v0.0.1"
                 },
             @{
                 @"name":@"作者",
                 @"value":@"DEV"
                 },
             @{
                 @"name":@"QQ",
                 @"value":@"1144183905"
                 },
             @{
                 @"name":@"邮箱",
                 @"value":@"1144183905@qq.com"
                 }];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return data.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if(!cell){
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    NSDictionary *dict = data[indexPath.row];
    cell.textLabel.text = [dict objectForKey:@"name"];
    cell.detailTextLabel.text = [dict objectForKey:@"value"];
    return cell;
}

- (void)showLeftMenu{
    LGSideMenuController *sideMenuCon = [self sideMenuController];
    [sideMenuCon showLeftViewAnimated:YES completionHandler:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
